#pragma once
#include <string>
#include <regex>

class CyRoutine
{
public:
	CyRoutine(void);
	~CyRoutine(void);

	static bool IsInteger(const std::wstring& num);
	static bool IsPositiveInteger(const std::wstring& num);
	static bool IsFloatingPoint(const std::wstring& num);
	static bool IsPositiveFloatingPoint(const std::wstring& num);
	static int GetInt(const std::wstring& num);
	static long long GetLongLong(const std::wstring& num);
	static float GetFloat(const std::wstring& num);
	static double GetDouble(const std::wstring& num);

private:
	static std::wregex REGEX_INT;
	static std::wregex REGEX_POS_INT;
	static std::wregex REGEX_FLOAT;
	static std::wregex REGEX_POS_FLOAT;
};

#define CY_THROW(MSG) \
		char _buffer_[300]; \
		sprintf_s(_buffer_, 300, \
			__FILE__ " : line %d : " MSG, __LINE__); \
		throw std::exception(_buffer_)